<template>
	<view>
		<web-view :src="url" :webview-styles="webviewStyles" @message="message"></web-view>
	</view>
</template>
<script>
	var wv; //计划创建的webview
	export default {
		data() {
			return {
				url: '',
				viewpostdata:'',
				webviewStyles: {
					progress: {
						color: '#378aff'
					}
				}
			}
		},
		onLoad(option) {
			if (option && option.url) {
				this.url = option.url;
			}
		},
		methods: {
			message(e) {
				if(e.type=="message"){
					console.log(e.detail)
					let copydata = e.detail.data;
					uni.setClipboardData({
						data: copydata[0].wechat,
						success() {
							console.log('success');
						}
					})
				}
			}
		}

	}
</script>
